<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<title>ISBN Parser - isbnjs sample</title>
<style type="text/css">
  div#title {
    font-size: x-large;
  }
  input.value {
    width: 150px;
    background-color: #e0e0ff;
  }
</style>
<script type="text/javascript" src="http://isbnjs.googlecode.com/svn/trunk/isbn.js"></script>
<script type="text/javascript" src="http://isbnjs.googlecode.com/svn/trunk/isbn-groups.js"></script>
<script type="text/javascript">
<!-- <![CDATA[
  function set(id, txt) {
    document.getElementById(id).value = txt;
  }
  function parse() {
    var txt = document.getElementById('isbn');
    var isbn = ISBN.parse(txt.value);
    if (isbn) {
      set('result', 'good');
      set('is_isbn_10', isbn.isIsbn10());
      set('is_isbn_13', isbn.isIsbn13());
      set('as_isbn_10', isbn.asIsbn10());
      set('as_isbn_13', isbn.asIsbn13());
      set('as_isbn_10_t', isbn.asIsbn10(true));
      set('as_isbn_13_t', isbn.asIsbn13(true));
      set('codes_groupname', isbn.codes.groupname);
    } else {
      set('result', 'bad');
    }
  }
// ]]> -->
</script>
</head>
<body>
<div id="title">ISBN Parser - isbnjs sample</div>
<div>
  ISBN:
  <input id="isbn" type="text" value="9784873113685" />
  <input id="parse" type="button" value="parse" onclick="parse()" />
</div>
<table>
  <tr>
    <td>result</td>
    <td><input id="result" class="value" type="text" readonly="readonly" /></td>
  </tr>
  <tr>
    <td>isIsbn10()</td>
    <td><input id="is_isbn_10" class="value" type="text" readonly="readonly" /></td>
  </tr>
  <tr>
    <td>isIsbn13()</td>
    <td><input id="is_isbn_13" class="value" type="text" readonly="readonly" /></td>
  </tr>
  <tr>
    <td>asIsbn10()</td>
    <td><input id="as_isbn_10" class="value" type="text" readonly="readonly" /></td>
  </tr>
  <tr>
    <td>asIsbn13()</td>
    <td><input id="as_isbn_13" class="value" type="text" readonly="readonly" /></td>
  </tr>
  <tr>
    <td>asIsbn10(true)</td>
    <td><input id="as_isbn_10_t" class="value" type="text" readonly="readonly" /></td>
  </tr>
  <tr>
    <td>asIsbn13(true)</td>
    <td><input id="as_isbn_13_t" class="value" type="text" readonly="readonly" /></td>
  </tr>
  <tr>
    <td>codes.groupname</td>
    <td><input id="codes_groupname" class="value" type="text" readonly="readonly" /></td>
  </tr>
</table>
</body>
</html>
